home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 1
/
Gold Medal Software Volume 1 (Gold Medal) (1994).iso
/
autocad
/
101hatch.arj
/
BATT.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1993-10-13
|
1KB
|
34 lines
; by Bryan Wallace of CAD Studio, Austin, Texas
;
; This routine automates the hatching of a
; parallelogram using the A6 (BATT) hatch pattern.
;
(defun C:BATT ()
(setvar "CMDECHO" 0)
(command "graphscr")
(setq PT1 (getpoint "\nFirst point... "))
(setq PT2 (getpoint "\nSecond point... "))
(setq PT3 (getpoint "\nThird point... \n"))
(setq D1 (distance PT1 PT2))
(setq PT4 (polar PT3 (angle PT2 PT1) D1))
(setq A1 (- (angle PT2 PT3) (angle PT1 PT2)))
(setq D2 (* (sin A1) D1))
(setq A2 (- (* 180 (/ (angle PT2 PT3) PI)) 90))
(setq SB (getvar "SNAPBASE"))
(setq SPB PT1)
(if ( = (length SPB) 3)
(setq SPB (list (car SPB) (cadr SPB) ))
)
(setvar "SNAPBASE" SPB)
(command "PLINE" PT1 PT2 PT3 PT4 "C" )
(command "HATCH" "A6" D2 A2 "L" "" )
(setvar "SNAPBASE" SB)
(setq X (getstring "\nERASE polyline created for boundary of hatch area? <Y or N> \n"))
(setq X (substr X 1 1))
(if (or (= X "Y") (= X "y"))
(command "ERASE" "P" "")
)
(setvar "CMDECHO" 1)
(princ)
)